package com.yongbao.model.dtomapper;

import com.yongbao.model.domain.UserDO;
import com.yongbao.model.request.UserRequest;
import com.yongbao.model.request.manual.UserUpdateRequest;
import com.yongbao.model.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * @author zhanghong
 */
@Mapper(componentModel = "spring")
public interface UserDtoMapper {

    UserDtoMapper INSTANCE = Mappers.getMapper(UserDtoMapper.class);

    /**
    * DO to VO
    * @param userDO
    * @return
    */
    UserVO do2VO(UserDO userDO);

    /**
     * request to DO
     * @param request
     * @return
     */
    UserDO request2DO(UserRequest request);

    /**
     * request to DO
     * @param request
     * @return
     */
    UserDO request2DO(UserUpdateRequest request);
}
